package com.leo.entity;

import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.entity.Entity;
import com.almasb.fxgl.entity.EntityFactory;
import com.almasb.fxgl.entity.SpawnData;
import com.almasb.fxgl.entity.Spawns;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;

public class BorderEntityFactory implements EntityFactory {

    @Spawns("borderPane")
    public Entity createBorderPane(SpawnData spawnData) {

        BorderPane root = new BorderPane();
        root.setPrefSize(FXGL.getAppWidth(), FXGL.getAppHeight());
        root.setLeft(new Label("12234"));
        root.setCenter(new Label("dsfsdfsd"));
        root.setStyle("-fx-border-width: 2px; -fx-border-color: red; -fx-border-style: solid");

        return FXGL.entityBuilder(spawnData)
                .viewWithBBox(root)
                .build();
    }
}
